#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    vector<int> searchRange(vector<int> &nums, int target)
    {
        int left = 0, right = nums.size() - 1;
        while (left <= right)
        {
            int mid = (left + right) / 2;
            if (nums[mid] < target)
                left = mid + 1;
            else if (nums[mid] >= target)
                right = mid - 1;
        }
        int start = left;
        left = 0, right = nums.size() - 1;
        while (left <= right)
        {
            int mid = (left + right) / 2;
            if (nums[mid] <= target)
                left = mid + 1;
            else if (nums[mid] > target)
                right = mid - 1;
        }
        int end = right;
        if (start > end)
            return {-1, -1};
        return {start, end};
    }
};
int main()
{
    cout << "Code34" << endl;
    Solution s;
    vector<int> nums = {5, 7, 7, 8, 8, 10};
    vector<int> ans = s.searchRange(nums, 6);
    cout << ans[0] << " " << ans[1] << endl;
    return 0;
}